<div id="content">
    <link href="<?php echo URL . 'template/' . MOD ?>/css/bill_info.css" rel="stylesheet" type="text/css"/>
    <h2 class="tit"><?php echo $lan['bill']; ?></h2>
    <?php
    if (empty($data['type'])) {
        $data['cont'] = '<table id="bill_info">
            <tr>';
        $i = 0;
        while ($i < count($lan['bill_tit'])) {
            $data['cont'].='<th>' . $lan['bill_tit'][$i] . '</th>';
            $i++;
        }
        $data['cont'].='</tr>
            <tr>
                <td>S_' . $data['bill_info']['id'] . '</td>
                <td>' . $data['bill_info']['cat_name'] . '</td>
                <td>' . number_format((double) $data['bill_info']['price'], 3, '.', '.') . '</td>
            </tr>
        </table>
        <div id="But_Bar">
            <a href="' . URL . 'dat-hang/' . $data['bill_info']['id'] . '/1"><div style="background: #DC5948" class="But_1">' . $lan['next'] . '</div></a>
        </div>';
        echo $data['cont'];
    } else {
        ?>
        <div class="clear"></div>
        <div class="tab">
            <a href="<?php echo DEF_URL . 'dat-hang/' . $data['bill_info']['id'] . '/1'; ?>"><h1 title="T_1" class="<?php echo ($data['type'] == 1 ? 'act' : '') ?>"><?php echo $lan['cus_info'] ?></h1></a>
            <a href="<?php echo DEF_URL . 'dat-hang/' . $data['bill_info']['id'] . '/2'; ?>"><h1 title="T_2" class="<?php echo ($data['type'] == 2 ? 'act' : '') ?>"><?php echo $lan['cus_com'] ?></h1></a>
            <div class="clear"></div>
            <div class="tab_con">
                <?php
                $tbl_add;
                if ($data['type'] == 1) {
                    echo '<div id="T_1" class="tab_c' . ($data['type'] == 2 ? 'con_act' : '') . '">';
                    $tbl_add = new tbl_add('customer', $lan, '', array(), array('cus_fax' => 1, 'cus_regency' => 1, 'cus_human' => 1, 'tax_code' => 1), 1);
                    echo '</div>';
                } else {
                    echo '<div id="T_2" class="tab_c ' . ($data['type'] == 2 ? 'con_act' : '') . '">';
                    $lan['customer'][1] = 'Tên công ty';
                    $tbl_add = new tbl_add('customer', $lan, '', array('id_temp' => $data['bill_info']['id']), array('cus_cmnd' => 1), 1);
                    echo '</div>';
                }
                if (isset($_POST['tbl_add'])) {
                    if ($tbl_add->flag !== 0) {
                        $adt = new ad_table();
                        $adt->customer_more($tbl_add->flag, $data['bill_info']['id']);
                        if ($tbl_add->a_var[11] == 0) {
                            echo '<p class="Sus">Thanh toán thành công</p>';
                        } else {
                            send_mail($tbl_add->a_var[3], $data['cont']);
                        }
                    } else {
                        echo '<p class="Err">Thanh toán thất bại</p>';
                    }
                }
                echo '<div class="clear"></div>';
            }
            ?>
            <div class="clear"></div>
        </div>